package com.controller;

import java.io.IOException;

import java.io.PrintWriter;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/Success")
public class Success extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		this.doPost(req, resp);
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		PrintWriter out = resp.getWriter();
		out.println("<html>");
		out.println("<head><title>登录成功的页面</title></head>");
		out.println("<body bgcolor='pink'><h1>用户"+req.getParameter("username")+"你好,欢迎登录学生管理系统!</h1><hr>");
		out.println("<table cellpadding='10' cellspacing='10'><tr><td>学生学号</td><td>学生姓名</td><td>学生宿舍号</td><td>学生手机号</td></tr>");
		out.println("<tr><td>001</td><td>小米</td><td>3-312</td><td>11111111</td></tr>");
		out.println("<tr><td>002</td><td>小黄</td><td>3-322</td><td>22222222</td></tr>");
		out.println("<tr><td>003</td><td>小明</td><td>3-325</td><td>33333333</td></tr>");
		out.println("</table></body>");
		out.println("</html>");
		out.close();
	}
		
}
